﻿@using Masa.Blazor.Presets

<MSwitch @bind-Value="left" Label="Left"></MSwitch>

<PDrawer Left="left"
         Title="Drawer here!">
    <ActivatorContent>
        <MButton @attributes="@context.Attrs">Activator</MButton>
    </ActivatorContent>
    <ChildContent>
        <MSimpleTable Dense>
            <thead>
            <tr>
                <th class="text-left">
                    Name
                </th>
                <th class="text-left">
                    Calories
                </th>
            </tr>
            </thead>
            <tbody>
            @foreach (var item in _desserts)
            {
                <tr @key="item">
                    <td>@item.name</td>
                    <td>@item.calories</td>
                </tr>
            }
            </tbody>
        </MSimpleTable>
    </ChildContent>
</PDrawer>

@code {

    bool left;

    private List<(string name, int calories)> _desserts = new()
    {
        ("Frozen Yogurt", 159),
        ("Ice cream sandwich", 237),
        ("Eclair", 262),
        ("Cupcake", 305),
        ("Gingerbread", 356),
        ("Jelly bean", 375),
        ("Lollipop", 392),
        ("Honeycomb", 408),
        ("Donut", 452),
        ("KitKat", 518),
    };

}